﻿using BlogDemo.Core.Entities;
using BlogDemo.Infrastructure.Database.EntityTypeConfigurations;
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Text;

namespace BlogDemo.Infrastructure.Database
{
    public class BlogContext
        : DbContext
    {
        public BlogContext(DbContextOptions options) 
            : base(options)
        {}
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.ApplyConfiguration(new PostConfig());
            base.OnModelCreating(modelBuilder);
        }
        public virtual DbSet<Post> Post { get; set; }
    }
}
